package com.lanou.service.impl;

import com.lanou.bean.RoleGuanLiBean;
import com.lanou.bean.RoleInfo;
import com.lanou.mapper.RoleInfoMapper;
import com.lanou.service.RoleInfoService;
import com.lanou.utils.AjaxResult;
import org.springframework.context.annotation.Role;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by dllo on 18/3/10.
 */
@Service
public class RoleInfoServiceImpl implements RoleInfoService {

    @Resource
    private RoleInfoMapper roleInfoMapper;
    @Override
    public List<RoleInfo> selectRoles(String name) {
        return roleInfoMapper.selectRoles(name);
    }

    @Override
    public List<RoleInfo> findAllRoles() {
        return roleInfoMapper.findAllRoles();
    }

    @Override
    public void addRole(RoleInfo roleInfo) {
        roleInfoMapper.addRole(roleInfo);
    }

    @Override
    public void deleteRole(int id) {
        roleInfoMapper.deleteRole(id);
    }

    @Override
    public RoleInfo select(String name) {
        return roleInfoMapper.selectRoleId(name);
    }

    @Override
    public List<RoleGuanLiBean> selectadminInfo() {
        List<RoleGuanLiBean> roleGuanLiBeanList = roleInfoMapper.selectadminInfo();
        return roleGuanLiBeanList;
    }

    @Override
    public RoleGuanLiBean selectRoleInfoById(int role_id) {
        return roleInfoMapper.selectRoleInfoById(role_id);
    }

    @Override
    public void upDataRoleInfo(int roleId, String name) {
        roleInfoMapper.upDataRoleInfo(roleId,name);
    }

    @Override
    public RoleInfo selectRoleByRoleName(String name) {
        RoleInfo roleInfo = roleInfoMapper.selectRoleByRoleName(name);
        return roleInfo;
    }


}
